<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
      let years = +prompt('请输入年份')
      let mon = +prompt('请输入月份')
      if (years % 400 === 0 || (years % 4 === 0 && years % 100 !== 0)) {
        switch (mon) {
          case 1:
            alert(`${mon}月有31天`)
            break
          case 2:
            alert(`${mon}月有29天`)
            break
          case 3:
            alert(`${mon}月有31天`)
            break
          case 4:
            alert(`${mon}月有30天`)
            break
          case 5:
            alert(`${mon}月有31天`)
            break
          case 6:
            alert(`${mon}月有30天`)
            break
          case 7:
            alert(`${mon}月有31天`)
            break
          case 8:
            alert(`${mon}月有31天`)
            break
          case 9:
            alert(`${mon}月有30天`)
            break
          case 10:
            alert(`${mon}月有31天`)
            break
          case 11:
            alert(`${mon}月有30天`)
            break
          case 12:
            alert(`${mon}月有31天`)
            break
          default:
            alert('请重新输入')
        }
      } else {
        switch (mon) {
          case 1:
            alert(`${mon}月有31天`)
            break
          case 2:
            alert(`${mon}月有28天`)
            break
          case 3:
            alert(`${mon}月有31天`)
            break
          case 4:
            alert(`${mon}月有30天`)
            break
          case 5:
            alert(`${mon}月有31天`)
            break
          case 6:
            alert(`${mon}月有30天`)
            break
          case 7:
            alert(`${mon}月有31天`)
            break
          case 8:
            alert(`${mon}月有31天`)
            break
          case 9:
            alert(`${mon}月有30天`)
            break
          case 10:
            alert(`${mon}月有31天`)
            break
          case 11:
            alert(`${mon}月有30天`)
            break
          case 12:
            alert(`${mon}月有31天`)
            break
          default:
            alert('请重新输入')
        }
      }
    </script>
</body>
</html>